# Middleware层存在的目的是为了提供给Adapter层作适配
include(${CMAKE_SOURCE_DIR}/cmake/common.cmake)
#---------------------第三方库-----------------------
set(MIDDLEWARE_DIR ${CMAKE_SOURCE_DIR}/Middleware)
set(THIRD_PARTY_DIR ${MIDDLEWARE_DIR}/Third_Party)

# -------lvgl库-------
set(LVGL_DIR ${THIRD_PARTY_DIR}/LVGL)
file(GLOB_RECURSE LVGL_SRCS
        # LVGL库
        "${LVGL_DIR}/lvgl/src/*.c"
        "${LVGL_DIR}/lvgl/examples/porting/*.c"
)
# 定义lvgl库的头文件目录
set(LVGL_INC_DIRS
        ${LVGL_DIR}
        ${LVGL_DIR}/lvgl/src
        ${LVGL_DIR}/lvgl/examples/porting
)
# 创建对象库
add_source_to_object(NAME MIDDLEWARE_LVGL INCLUDES ${LVGL_INC_DIRS} SOURCES ${LVGL_SRCS})


# ------FreeRTOS库------
set(FREERTOS_DIR ${THIRD_PARTY_DIR}/FreeRTOS)
file(GLOB_RECURSE FREERTOS_SRCS
        "${FREERTOS_DIR}/Source/*.c"
        "${FREERTOS_DIR}/Source/CMSIS_RTOS_V2/cmsis_os2.c"
        "${FREERTOS_DIR}/Source/portable/GCC/ARM_CM4F/port.c"
)
# FreeRTOS依赖于CMSIS，而CMSIS部分依赖于HAL，所以引入BSP目录
set(FREERTOS_INC_DIRS
        ${FREERTOS_DIR}
        ${FREERTOS_DIR}/Source/include
        ${FREERTOS_DIR}/Source/CMSIS_RTOS_V2
        ${FREERTOS_DIR}/Source/portable/GCC/ARM_CM4F
)
# 创建对象库
add_source_to_object(NAME MIDDLEWARE_FREERTOS INCLUDES ${FREERTOS_INC_DIRS} SOURCES ${FREERTOS_SRCS})

# ------DSP库------

